import React from 'react'
import { Navigate } from "react-router-dom";
import Home from '../pages/Home'
import About from '../pages/About'
import News from '../pages/News';
import Messages from '../pages/Messages';

export default [
  {
    path: '/home',
    element:<Home/>
  },
  {
    path: '/about',
    element:<About/>,
    children:[
      {
        // 这里加 /就必须写前缀
        path: 'news',
        element:<News/>
      },
      {
        path: 'messages',
        element:<Messages/>
      }
    ]
  },
  {
    path: '/',
    element:<Navigate to='/about'/>
  }
]